#region

using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

#endregion

namespace AchievementSample.Converters
{
    public class BooleanToInvisibilityConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is bool))
                throw new ArgumentException("value must be a bool.");

            bool booleanValue = !((bool) value);

            return booleanValue ? Visibility.Visible : Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}